package com.hzncc.flowable_diboot.vo.invoicemanage;

import com.diboot.core.binding.annotation.*;
import com.diboot.core.vo.FileVO;
import com.diboot.core.vo.LabelValue;
import com.diboot.iam.entity.IamOrg;
import com.diboot.iam.entity.IamPosition;
import com.diboot.iam.entity.IamRole;
import com.diboot.iam.entity.IamUser;
import com.diboot.file.entity.FileRecord;
import com.diboot.tenant.entity.IamTenant;
import com.hzncc.flowable_diboot.entity.invoicemanage.InvoiceProduct;
import com.hzncc.flowable_diboot.entity.invoicemanage.InvoiceRegister;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;
import java.time.LocalDate;

/**
* 开票登记 VO定义
* @author MyName
* @version 1.0
* @date 2024-11-06
* Copyright © MyCorp
*/
@Getter @Setter @Accessors(chain = true)
public class InvoiceRegisterListVO extends InvoiceRegister  {
private static final long serialVersionUID = 1191517216185589222L;

    /**
    * 创建人 关联信息
    */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.create_by = id")
    private String createByLabel;

    /**
    * 更新人 关联信息
    */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.update_by = id")
    private String updateByLabel;

    /**
     * 是否登记 关联字典选项
     */
    @BindDict(type = "yesNo", field = "registered")
    private LabelValue registeredLabel;

    /**
     * 销售组织 关联字典选项
     */
    @BindDict(type = "salesGroup", field = "salesOrganization")
    private LabelValue salesOrganizationLabel;

    /**
     * 是否收款完成 关联字典选项
     */
    @BindDict(type = "yesNo", field = "paymentCompleted")
    private LabelValue paymentCompletedLabel;

    /**
     * 开票类型
     */
    @BindDict(type = "invoiceCategory",field = "invoiceCategory")
    private LabelValue invoiceCategoryLabel;

    /**
     * 发票类型 字典信息
     */
    @BindDict(type = "invoiceType", field = "invoiceType")
    private LabelValue invoiceTypeLabel;

    /**
     * 领取人 关联信息
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.claimant = id")
    private String claimantLabel;

    @BindField(
            entity = IamUser.class,
            field = "userNum",
            condition = "this.claimant = id"
    )
    private String claimantNo;


    /**
     * 收件人 关联信息
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.sender = id")
    private String senderLabel;

    @BindField(
            entity = IamUser.class,
            field = "userNum",
            condition = "this.sender = id"
    )
    private String senderNo;

    /**
     * 回执类型 关联信息
     */
    @BindDict(type = "receiptType", field = "receiptType")
    private LabelValue receiptTypeLabel;

    /**
     * 开票登记管理和合同项目信息
     */
    @BindEntity(entity = InvoiceProduct.class, condition = "this.id = invoice_register_id",deepBind = true)
    private InvoiceProductListVO invoiceProduct;

    /**
     * 回执单文件是否回执 关联字典选项
     */
    @BindDict(type = "yesNo", field = "receipted")
    private LabelValue receiptedLabel;

}